import request from '@/utils/request'

// 查询supplyDetail列表
export function listSupplyDetail(query) {
  return request({
    url: '/supplyDetail/list',
    method: 'get',
    params: query
  })
}

// 查询supplyDetail详细
export function getSupplyDetail(rawProductBatch) {
  return request({
    url: '/supplyDetail/' + rawProductBatch,
    method: 'get'
  })
}

// 新增supplyDetail
export function addSupplyDetail(data) {
  return request({
    url: '/supplyDetail',
    method: 'post',
    data: data
  })
}

// 新增supplyDetail
export function addSupplyDetailList(data) {
  return request({
    url: '/supplyDetail/addList',
    method: 'post',
    data: data
  })
}

// 修改supplyDetail
export function updateSupplyDetail(data) {
  return request({
    url: '/supplyDetail',
    method: 'put',
    data: data
  })
}

// 删除supplyDetail
export function delSupplyDetail(rawProductBatch) {
  return request({
    url: '/supplyDetail/' + rawProductBatch,
    method: 'delete'
  })
}

//根据多个货品批号获取货源详情
export function getSupplyDetailByBatches(rawProductBatches) {
  return request({
    url: '/supplyDetail/batches',
    method: 'post',
    data: rawProductBatches
  })
}

//批量更新货源详情
export function updateSupplyDetailList(data) {
  return request({
    url: '/supplyDetail/updateList',
    method: 'post',
    data: data
  })
}

//根据调拨编号获取货源详情
export function getSupplyDetailByAllocationNo(allocationNo) {
  return request({
    url: '/supplyDetail/list/allocationNo',
    method: 'post',
    data: allocationNo
  })
}
